import { BrowserRouter,Routes, Route, Link,Navigate, } from "react-router-dom"
import './App.css';

// import Home from './views/Home.jsx'
// import Classify from './views/Classify.jsx'
// import Cart from './views/Cart.jsx'
import Tab from './views/Tab.jsx'
// import Info from './views/Info.jsx'
import routes from './router/index'
function App() {

  return (
    
    <BrowserRouter>
   <div>
    <ul>
      <li><Link to='/home'>首页</Link></li>
      <li><Link to='/Classify'>分类</Link></li>
      <li><Link to='/Cart'>购物车</Link></li>
    </ul>
    <Tab></Tab>
    <div>
      <Routes>
        {/* <Route path="/home" element={<Home/>}></Route>
        <Route path="/Classify" element={<Classify/>}></Route>
        <Route path="/Cart" element={<Cart/>}></Route>
        <Route path="/Info/:id" element={<Info/>}></Route>
       <Route path='/' element={<Navigate to='/Classify'></Navigate>}></Route>
       <Route path="*" element={<div>404</div>}></Route> */}
       {
          routes.map((item,i)=><Route path={item.path} element={<div>{item.element}</div>} key={i}></Route>)
       }
      </Routes>
    </div>
    
   </div> 
   </BrowserRouter>
  )
}

export default App;
